﻿using ModernShopping.AppCode;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ModernShopping.User
{
    public partial class Home : System.Web.UI.Page
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            LoginInfo loginInfo = Session.GetLoginInfo();
            if (loginInfo == null)
            {
                Response.GoToAccessDeniedPage(Request);
            }
            if (!loginInfo.IsUser())
            {
                Response.GoToAccessDeniedPage(Request);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoginInfo loginInfo=Session.GetLoginInfo();
                lblCompanyName.Text = DbCompany.getCompany(loginInfo.UserID).Name;
            }
        }
    }
}